xen/arm: Survive unknown traps from guests
authorJulien Grall <julien.grall@arm.com>
Fri, 5 May 2017 14:30:36 +0000 (15:30 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 8 May 2017 20:21:34 +0000 (13:21 -0700)
commitbaf2950213e6a50801940643e2549a5baa21ad71
tree8661090d4038cabc35b9e7737a65280ed33a543f
parent5a0ed9a09ebb32b620d9217875bb5206d5ccf4d7
xen/arm: Survive unknown traps from guests

Currently we crash Xen if we see an ESR_EL2.EC value we don't recognise.
As configurable disables/enables are added to the architecture
(controlled by RES1/RESO bits respectively), with associated synchronous
exceptions, it may be possible for a guest to trigger exceptions with
classes that we don't recognise.

While we can't service these exceptions in a manner useful to the guest,
we can avoid bringing down the host. Per ARM DDI 0487A.k_iss10775, page
D7-1937, EC values within the range 0x00 - 0x2c are reserved for future
use with synchronous exceptions, and EC within the range 0x2d - 0x3f may
be used for either synchronous or asynchronous exceptions.

The patch makes Xen handle any unknown EC by injecting an UNDEFINED
exception into the guest, with a corresponding (ratelimited) warning in
the log.

This patch is based on Linux commit f050fe7a9164 "arm: KVM: Survive unknown
traps from the guest".

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/traps.c